/**
 * Copyright(c) 2014 Xunton Solutions
 *
 * History:
 *   15-5-25 下午5:05 Created by dwzhang
 */
package com.jade.modules.media;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 * 管理图片、声音、视频、音频等媒体资料。.
 *
 * @author <a href="mailto:dwzhang@xunton.com">dwzhang</a> 
 * @version 1.0 15-5-25 下午5:05
 */
//@Entity
//@Table (name = "MODULE_MEDIA_ITEM")
public class CMediaItem implements Serializable
{
    public static final String TYPE_IMAGE = "image";
    public static final String TYPE_VOICE = "voice";
    public static final String TYPE_VIDEO = "video";
    public static final String TYPE_FILE = "file";
    public static final String TYPE_SOFTWARE = "software";

    //标识
    @Id
    @GeneratedValue (generator = "MODULE_SEQ_MEDIA_ITEM")
    @SequenceGenerator (name = "MODULE_SEQ_MEDIA_ITEM", sequenceName = "MODULE_SEQ_MEDIA_ITEM")
    private long id;
    @Column (name = "uri", length = 128)
    private String uri;
    //资料类型
    @Column (name = "type", length = 32, nullable = false)
    private String type;
    //应用类型，主要是为了归类查找
    @Column (name = "app", length = 32, nullable = false)
    private String app = "default";
    //内容类型，例如image/jpg, image/png等
    @Column (name = "content_type", length = 64)
    private String contentType;
    //资料大小
    @Column (name = "size")
    private long size;
    //资料名称
    @Column (name = "name", length = 64)
    private String name;
    //备注说明
    @Column (name = "remark", length = 512)
    private String remark;
    @Column (name = "creation_date", nullable = false, updatable = false)
    private Date creationDate;

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public String getUri()
    {
        return uri;
    }

    public void setUri(String uri)
    {
        this.uri = uri;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public String getApp()
    {
        return app;
    }

    public void setApp(String app)
    {
        this.app = app;
    }

    public String getContentType()
    {
        return contentType;
    }

    public void setContentType(String contentType)
    {
        this.contentType = contentType;
    }

    public long getSize()
    {
        return size;
    }

    public void setSize(long size)
    {
        this.size = size;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }

    public Date getCreationDate()
    {
        return creationDate;
    }

    public void setCreationDate(Date creationDate)
    {
        this.creationDate = creationDate;
    }
}
